package com.service.impl;

import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.beans.UserInfo;
import com.mapper.UserMapper;
import com.service.UserService;

@Service @Transactional
public class UserServiceImpl implements UserService {
	@Resource
	private UserMapper userMapper;

	public int addUser(UserInfo user) {
		return userMapper.add_user(user);
	}

	public UserInfo getUser(int id) {
		return userMapper.get_user(id);
	}

	public int delUser(int id) {
		return userMapper.del_user(id);
	}

	public int updateUser(UserInfo user) {
		return userMapper.update_user(user);
	}

	public List<UserInfo> selectAll() {
		return userMapper.select_all();
	}

	public UserInfo login(String userName, String password) {
		  return userMapper.login(userName, password);
		 }
}
